home *** CD-ROM | disk | FTP | other *** search
/ Ahoy: Best of 1985 / Ahoy_Best_of_1985_1986_Double_L.d64 / tile time may'85 (.txt) < prev   
Commodore BASIC  |  2022-10-26  |  6KB  |  195 lines

  1. 1 rem -------- the tile game ----------
  2. 2 rem   (c) murdock & blackburn '84
  3. 3 rem           10/15/1984
  4. 4 rem
  5. 100 forx=1to6:readch:co$(x)=chr$(ch):next
  6. 110 data 28,158,156,30,150,5
  7. 120 b1$=chr$(154):b2$=chr$(31):b3$=chr$(152):c1$=b1$:c2$=chr$(144)
  8. 130 sc$=chr$(147):hm$=chr$(19)
  9. 135 print sc$;co$(6)
  10. 140 poke53280,2:poke53281,2:printspc(249)"hold on, just a second"
  11. 150 do$=hm$:forx=1to24:do$=do$+chr$(17):next
  12. 160 u3$="":forx=1to3:u3$=u3$+chr$(145):next
  13. 170 r3$="":forx=1to3:r3$=r3$+chr$(29):next
  14. 180 l5$="":forx=1to5:l5$=l5$+chr$(157):next
  15. 190 sp$="":forx=1to39:sp$=sp$+" ":next
  16. 200 sz$=chr$(17)+chr$(29)+chr$(110)+chr$(163)+chr$(109)+chr$(157)+chr$(157)
  17. 210 sz$=sz$+chr$(157)+chr$(17)+chr$(125)
  18. 220 t$=chr$(111)+chr$(183)+chr$(183)+chr$(183)+chr$(112)+l5$+chr$(17)
  19. 230 t$=t$+chr$(165)+r3$+chr$(167)+l5$+chr$(17)
  20. 240 t$=t$+chr$(165)+r3$+chr$(167)+l5$+chr$(17)
  21. 250 t$=t$+chr$(108)+chr$(175)+chr$(175)+chr$(175)+chr$(186)+l5$+u3$
  22. 260 bs$=b2$:forx=1to5:bs$=bs$+chr$(166):next
  23. 270 bs$=bs$+l5$+chr$(17):bt$="":for x=1to4:bt$=bt$+bs$:next:bs$=bt$+b1$
  24. 280 dimch$(24):for x=1to24:readch$:ch$(x)=ch$:next
  25. 290 data a,b,c,d,e
  26. 295 data f,g,h,i,j
  27. 300 data k,l,m,n,o
  28. 305 data p,q,r,s,t
  29. 310 data u,v,w,x
  30. 320 if peek(49475)<>234 or peek(49806)<>24then gosub9010
  31. 330 px=0:poke53280,px:poke53281,px
  32. 340 printsc$:k$=""
  33. 350 printdo$;sp$;b1$;:gosub8010:goto360
  34. 360 printhm$;
  35. 370 row=5:col=1:br=5:bc=5:mv=0:cu$=t$
  36. 380 print do$;spc(7);co$(2);"joystick or keyboard  (j/k)"c2$;
  37. 390 getkk$:ifkk$=""then390
  38. 400 ifkk$="j" then420
  39. 410 ifkk$<>"k" then390
  40. 420 printdo$;sp$;:gosub3040
  41. 430 rem ***  mix y/n print  ***
  42. 440 printco$(4);do$;left$(sp$,15);"mix  (y/n)";
  43. 450 geta$:ifa$=""then450
  44. 460 ifa$= "y"then printdo$;sp$;:gosub3040:gosub4010:mv=0:printdo$;sp$;:goto490
  45. 470 ifa$= "n"then printdo$;sp$;:goto490
  46. 480 goto450
  47. 490 cu$=t$:gosub3040:ifkk$="k" then7000
  48. 500 goto2010
  49. 1000 rem ***  scroll routine  ***
  50. 1010 mv=mv+1:printdo$b2$"move"b1$;mv;
  51. 1020 on d goto1030,1050,1060,1080
  52. 1030 ml=49661:r=5:vu=0:col=col-hu
  53. 1040 goto1090:rem *left
  54. 1050 ml=49735:r=5:vu=0:goto1090:rem *rt
  55. 1060 ml=49416:r=4:hu=0:row=row-vu
  56. 1070 goto1090:rem *up
  57. 1080 ml=49483:r=4:hu=0:goto1090:rem *dn
  58. 1090 l=(col-1)*5+8:t=(row-1)*4+2
  59. 1100 h=(hu+1)*5:v=(vu+1)*4
  60. 1110 poke251,l:poke252,t:poke253,h-1:poke254,v-1
  61. 1120 gosub6510
  62. 1130 for x=1tor
  63. 1140 poke254,v-1:poke2,1
  64. 1150 sys ml
  65. 1160 next
  66. 1170 poke s+4,16
  67. 1180 return
  68. 1500 get k$:if k$=""then1500
  69. 1510 return
  70. 2000 rem ***   read joy stick  ***
  71. 2010 jv=peek(56320)
  72. 2020 getk$:ifk$=chr$(147)then350
  73. 2030 fr=jvand16:if fr<>16then gosub5010:goto2010
  74. 2040 jv=15-(jvand15)
  75. 2050 if jv=0 then gosub2110:goto2010
  76. 2060 if jv=1 and row>1 then row=row-1:gosub3010:goto2010
  77. 2070 if jv=2 and row<5 then row=row+1:gosub3010:goto2010
  78. 2080 if jv=8 and col<5 then col=col+1:gosub3010:goto2010
  79. 2090 if jv=4 and col>1 then col=col-1:gosub3010:goto2010
  80. 2100 goto2010:rem * invalid direction *
  81. 2110 printc1$;t$;
  82. 2120 printc2$;t$;
  83. 2130 return
  84. 3000 rem *******  set cursor  *******
  85. 3010 if fl then cu$=bs$
  86. 3020 printc1$;cu$;c2$;
  87. 3030 cu$=t$
  88. 3040 r=(row-1)*4+2:c=(col-1)*5+8
  89. 3050 poke251,r:poke252,c
  90. 3060 sys 49806
  91. 3070 printcu$;
  92. 3080 if row=br and col=bc then fl=1:goto3100
  93. 3090 fl=0
  94. 3100 return
  95. 4000 rem *******  random mix  *******
  96. 4010 a=rnd(rnd(0)):printleft$(do$,5);b2$;"mixing"b1$;:gosub3040
  97. 4020 for mx=1 to 20
  98. 4030 gosub4180
  99. 4040 ifa2=1thenrow=br:col=bc-a:goto4060
  100. 4050 row=br:col=bc+a
  101. 4060 if col<1 or col>5 then4030
  102. 4070 gosub3010:gosub5010
  103. 4080 getk$:ifk$<>"" then4160
  104. 4090 gosub4180
  105. 4100 ifa2=1thencol=bc:row=br-a:goto4120
  106. 4110 col=bc:row=br+a
  107. 4120 if row<1 or row>5 then4090
  108. 4130 gosub3010:gosub5010
  109. 4140 getk$:ifk$<>"" then4160
  110. 4150 next
  111. 4160 printleft$(do$,5);left$(sp$,6);:gosub3040
  112. 4170 return
  113. 4180 a=int(rnd(1)*4)+1
  114. 4190 a2=int(rnd(1)*2)
  115. 4200 return
  116. 5000 rem ***  prepare to scroll  ***
  117. 5010 if col<>bc then5060
  118. 5020 if br=row then return
  119. 5030 vu=abs(row-br):d=4:tr=row+1
  120. 5040 if br<row then d=3:tr=row-1
  121. 5050 br=row:gosub1010:row=tr:gosub3040:return
  122. 5060 if row<>br then gosub6010:return
  123. 5070 hu=abs(col-bc):d=2:tc=col+1
  124. 5080 if bc<col then d=1:tc=col-1
  125. 5090 bc=col:gosub1010:col=tc:gosub3040:return
  126. 5100 if col<>bc then return
  127. 6000 rem *******  buzzer  *******
  128. 6010 fora=1to8:poke54296,15:fort=1to3:next:poke54296,0:fort=1to3:next:next
  129. 6020 return
  130. 6500 rem ***  pong subroutine  ***
  131. 6510 s=54272
  132. 6520 poke s+1,20
  133. 6530 poke s+5,9
  134. 6540 poke s+6,9
  135. 6550 poke s+24,4
  136. 6560 poke s+4,17
  137. 6570 return
  138. 7000 rem ***  get keyboard input  ***
  139. 7010 getk$:ifk$="" then gosub2110:goto7010
  140. 7020 ifk$=chr$(147)then350
  141. 7030 ifk$=" " then gosub5000:goto7010
  142. 7040 if k$="a" and row>1 then row=row-1:gosub3010:goto7010
  143. 7050 if k$="z" and row<5 then row=row+1:gosub3010:goto7010
  144. 7060 if k$="." and col<5 then col=col+1:gosub3010:goto7010
  145. 7070 if k$="," and col>1 then col=col-1:gosub3010:goto7010
  146. 7080 goto7010
  147. 8000 rem *******  draw board  *******
  148. 8010 ch=1:printb1$;:ifk$=chr$(147)then8100
  149. 8020 printhm$;spc(6);chr$(117);:forx=1to27:printchr$(96);:next:printchr$(105)
  150. 8030 printspc(6)chr$(98);" ";:forx=1to25:printchr$(164);:next:print" "chr$(98)
  151. 8040 printleft$(do$,2):for x=1 to 20
  152. 8050 print spc(6);chr$(98);chr$(167);spc(25);chr$(180);chr$(98)
  153. 8060 next
  154. 8070 printhm$;left$(do$,23);
  155. 8080 printspc(6)chr$(98);" ";:forx=1to25:printchr$(163);:next:print" "chr$(98)
  156. 8090 printspc(6);chr$(106);:forx=1to27:printchr$(96);:next:printchr$(107)
  157. 8100 for row=1 to 5
  158. 8110 for col=1 to 5
  159. 8120 if row=5 and col=5 then printb3$;:cu$=bs$:gosub3040:goto8170
  160. 8130 printb3$;:cu$=bs$:gosub 3040
  161. 8140 printb1$;:cu$=t$:gosub3040
  162. 8150 printb2$;:cu$=sz$:gosub3040
  163. 8160 printco$(row);ch$(ch);b2$;chr$(125):ch=ch+1
  164. 8170 next col
  165. 8180 next row
  166. 8190 return
  167. 9000 rem *******  ml routines  *******
  168. 9010 fori=49416to49815
  169. 9020 readt:pokei,t:next
  170. 9030 return
  171. 49416 data32,226,193,165,251,166,252,32,155,193,32,205,193,166,254,202,48
  172. 49433 data21,24,165,208,105,40,133,210,133,214,165,209,105,0,133,211,32
  173. 49450 data119,193,202,16,235,164,253,185,32,192,145,208,185,72,192,145,212
  174. 49467 data136,16,243,32,226,193,88,96,234,234,234,234,234,234,234,234,32
  175. 49484 data226,193,32,132,194,170,165,251,32,155,193,32,205,193,166,254,202
  176. 49501 data240,208,56,165,208,233,40,133,210,133,214,165,209,233,0,133,211
  177. 49518 data24,32,119,193,202,16,234,48,184,41,3,9,216,133,215,164,253
  178. 49535 data177,210,145,208,177,214,145,212,136,16,245,165,211,133,209,165,210
  179. 49552 data133,208,165,215,133,213,165,214,133,212,96,72,169,216,133,208,172
  180. 49569 data136,2,136,132,209,24,165,208,105,40,133,208,165,209,105,0,133
  181. 49586 data209,202,16,240,24,104,101,208,133,208,133,212,165,209,105,0,133
  182. 49603 data209,41,3,9,216,133,213,164,253,96,165,2,208,3,169,32,44
  183. 49620 data177,208,153,32,192,177,212,153,72,192,136,16,236,96,120,162,30
  184. 49637 data181,208,72,189,0,192,149,208,104,157,0,192,202,16,241,96,234
  185. 49654 data234,234,234,234,234,234,234,32,226,193,32,132,194,165,251,166,211
  186. 49671 data32,155,193,160,0,177,208,133,210,177,212,72,144,13,200,177,208
  187. 49688 data72,177,212,136,145,212,104,145,208,200,196,253,144,239,165,2,208
  188. 49705 data3,169,32,44,165,210,145,208,104,145,212,198,211,198,254,16,201
  189. 49722 data32,226,193,88,96,234,234,234,234,234,234,234,234,32,226,193,32
  190. 49739 data132,194,165,251,166,211,32,155,193,177,208,133,210,177,212,72,164
  191. 49756 data253,240,15,136,177,208,72,177,212,200,145,212,104,145,208,136,208
  192. 49773 data241,165,2,208,3,169,32,44,165,210,145,208,104,145,212,198,211
  193. 49790 data198,254,16,203,48,182,166,252,138,24,101,254,133,211,96,234,24
  194. 49807 data164,252,166,251,32,240,255,96,234
  195.